home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.arch.arithmetic,comp.lang.c,comp.lang.c++
- Path: Utrecht.NL.net!news
- From: Franz Korntner <fkorntne@bazis.nl>
- Subject: Re: Access carry flag from C
- X-Nntp-Posting-Host: bastion1.bazis.nl
- Content-Type: text/plain; charset=us-ascii
- Message-ID: <312D803A.41C6@bazis.nl>
- Sender: news@inter.NL.net (News at newsutr)
- Content-Transfer-Encoding: 7bit
- Organization: NLnet
- References: <Dn1C9z.DGv.0.net@indra.com> <1996Feb1922.17.19.879@koobera.math.uic.edu> <31298D20.41C6@bazis.nl> <danpop.824859220@rscernix> <312AFACE.41C6@bazis.nl> <danpop.824991840@rscernix>
- Mime-Version: 1.0
- Date: Fri, 23 Feb 1996 08:52:10 GMT
- X-Mailer: Mozilla 2.0 (X11; I; OSF1 V3.2 alpha)
-
- Dan Pop wrote:
- >
- > In <312AFACE.41C6@bazis.nl> fkorntne@bazis.nl (Franz Korntner) writes:
- >
- > >What will the future hold for 64 bit or larger machines. For the Alpha
- > >they declared int to be a 32 bit datatype because too many coders relied
- > >on this.
- >
- > No, this is not the real reason. They made long and all pointers to
- > be 64-bit (on OSF/1, OpenVMS is a pure 32-bit implementation on Alpha),
- > despite the fact that a huge amount of existing software relied on silly
- > assumptions like: long is 32 bits, or long is the same size as int, or
- > any pointer can be stored in an int. I had a hard time porting a piece
- > >Real pity as int should denote the natural size of the machine,
- > >and in the case of the Alpha it should have been 64!
- >
- > 32-bit is just as natural for Alpha as 64-bit (the architecture supports
- > both 32 and 64-bit memory accesses). Having two integer types of the same
- > size on Alpha would have been a waste. It _is_ a waste to have both int
- > and long the same size on 32-bit platforms and add a non-standard long long
- > type for 64-bit types (to avoid upsetting the customers whose brain-dead
- > software would break if long and int would be different sizes).
-
- What I also really mis is a method to declare a location to be x bits.
-
- GCC has a working solution:
-
- typedef int QItype __attribute__ ((mode (QI))); /* 8 bit */
- typedef unsigned int UQItype __attribute__ ((mode (QI)));
- typedef int HItype __attribute__ ((mode (HI))); /* 16 bit */
- typedef unsigned int UHItype __attribute__ ((mode (HI)));
- typedef int SItype __attribute__ ((mode (SI))); /* 32 bit */
- typedef unsigned int USItype __attribute__ ((mode (SI)));
- typedef int DItype __attribute__ ((mode (DI))); /* 64 bit */
- typedef unsigned int UDItype __attribute__ ((mode (DI)));
- typedef float SFtype __attribute__ ((mode (SF))); /* 32 bit */
- typedef float DFtype __attribute__ ((mode (DF))); /* 96 bit */
-
- but it sure ain't standard. Pity that I have to use this method to achieve
- my goal!
-
- --
- +-----------------------------------------------------------------------+
- | Franz Korntner at BAZIS, dept. System Development, Leiden, Netherlands|
- | E-mail: fkorntne@hiscom.nl |
- +-----------------------------------------------------------------------+
-